package com.huatai.datadevelop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huatai.datadevelop.entity.ApiSuperviseEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;

/**
 * @author hecai
 */
@Mapper
public interface ApiSuperviseMapper extends BaseMapper<ApiSuperviseEntity> {

    /**
     * 根据状态获取该状态下相关统计数据
     * @param type
     * @return
     */
    @Select(" select type,count(type) as count " +
            " from api_supervise " +
            " where `status` = ${status} " +
            " group by type ")
    List<HashMap<String,Integer>> getCountDataByType(@Param("status")Integer status);
}
